﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.Collections;

namespace NMoq.Core
{
    public class DefaultVerifier:IVerifier
    {
        #region 
        public Func<object[],bool> VerifyDelegate
        {
            get;
            set;
        }
        #endregion

        #region constructors
        public DefaultVerifier()
        { 
        }
        public DefaultVerifier(Func<object[], bool> verifyDelegate)
            : this()
        {
            VerifyDelegate = verifyDelegate;
        }
        #endregion

        #region IVerifier Members
        public bool Verify(MethodMessageInfo methodMessageInfo)
        { 
            if (VerifyDelegate!= null )
            {
                return (bool)VerifyDelegate.Invoke (methodMessageInfo.Args );
            }
            return true;
        }
        #endregion
    }
}
